import { axiosOptions, axiosRequest } from '@/utils/request'

let Base64 = require('js-base64').Base64;
// 登录方法
export function login(name, passWord, code) {
  passWord = Base64.encode(passWord)
  const data = {
    name,
    passWord,
    code,
  }
  return axiosRequest('admin/login', data)
}

// 获取用户详细信息
export function getInfo() {
  let options = axiosOptions('get')
  return axiosRequest('admin/getInfo',null,options);
}

// 退出方法
export function logout() {
  return axiosRequest('/admin/logout');
}

// 获取验证码
export function getCodeImg() {
  let option = axiosOptions('get');
  return axiosRequest('/verifyCode?'+new Date().getTime(),null,option);
}
